import http from '../../utils/http.js';
// pages/class/class.js
Page({
  data: {//变量名赋值
    level1: [],
    level2: [],
    level3: []
  },
  onLoad: function () {//页面加载完成事件
    this.getData();
  },
  getData() {
    http.get('/classList').then(data => {//获取课程的数据
      if (data.code == 0) {
        let { level1, level2, level3 } = data.data;//对象解构赋值
        this.setData({
          level1,
          level2,
          level3
        })
      }
    })
  }
})